//
//  LockObject.swift
//  EasySwift
//
//  Created by 王隆帅 on 2017/7/6.
//  Copyright © 2017年 王隆帅. All rights reserved.
//

import UIKit

class LockObject: NSObject {
    
    var lockArray: Array<Any> = [];
    
    
    public func saveSomethingToLockObject(saveObject: NSString) {
        
    
        print(#function);
        print(Date());
        lockArray.append(saveObject)
    }
    
    public func deleteSomethingFromLockObject(deleteObject: NSString) -> (Bool) {
        
        print(#function);
        print(Date());

        let isHas = lockArray.contains { $0 as! NSString == deleteObject}
        
        let index = lockArray.index{ $0 as! NSString == deleteObject}
        
        lockArray.remove(at: index!);
        
        return isHas;
    }

}
